/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DataBase;

import java.util.logging.Level;
import java.util.logging.Logger;

 /*
  * @author Cristina
  */
//design patterns singelton + factory
public class DataFactory {

    private static DataFactory datafactory = null;


    private DataFactory()
    {

    }

    public static DataFactory getInstance()
    {
        if(datafactory == null)
        {
            datafactory = new DataFactory();
            //return datafactory;
        }
        return datafactory;
    }
    public RequestI makeRequest(String db, String pass)
    {
        try {
            Requests r = new Requests(db, pass);
            return r;
        } catch (Exception ex) {
            FileRequest f = new FileRequest();
            return f;
            //Logger.getLogger(DataFactory.class.getName()).log(Level.SEVERE, null, ex);
        }
    }



}
